home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swags_z.zip / STRINGS.SWG / 0053_Trim STRING on the RIGHT.pas < prev    next >
Pascal/Delphi Source File  |  1993-09-26  |  681b  |  17 lines

  1. {*****************************************************************************
  2.  * Function ...... RTrim()
  3.  * Purpose ....... To trim a character off the right side of a string
  4.  * Parameters .... s       String to trim
  5.  *                 c       Character to trim from <s>
  6.  * Returns ....... <s> with all characters <c> removed from the right side
  7.  * Notes ......... None
  8.  * Author ........ Martin Richardson
  9.  * Date .......... October 2, 1992
  10.  *****************************************************************************}
  11. FUNCTION RTrim( s: STRING; c: CHAR ): STRING;
  12. BEGIN
  13.       WHILE (LENGTH(s) > 0) AND (s[LENGTH(s)] = c) DO DEC(s[0]);
  14.       RTrim := s;
  15. END;
  16.  
  17.